From aff9115de591304a2ae26061ad0ba77f6d674ac9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roger=20Pau=20Monn=C3=A9?= Date: Thu, 3 Dec 2015 15:33:40 +0100 Subject: [PATCH] x86: make sure the HVM callback vector is correctly set MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit If certain devices (like the local or the io apic) are disabled some modes of operation of the HVM event channel callback cannot be used. Make sure Xen doesn't try to setup them. Signed-off-by: Roger Pau Monné Acked-by: Jan Beulich --- xen/arch/x86/hvm/irq.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xen/arch/x86/hvm/irq.c b/xen/arch/x86/hvm/irq.c index 990a2ca379..0f3ab6c60c 100644 --- a/xen/arch/x86/hvm/irq.c +++ b/xen/arch/x86/hvm/irq.c @@ -330,6 +330,10 @@ void hvm_set_callback_via(struct domain *d, uint64_t via) (via_type > HVMIRQ_callback_vector) ) via_type = HVMIRQ_callback_none; + if ( via_type != HVMIRQ_callback_vector && + (!has_vlapic(d) || !has_vioapic(d) || !has_vpic(d)) ) + return; + spin_lock(&d->arch.hvm_domain.irq_lock); /* Tear down old callback via. */ -- 2.30.2